package com.qjquestion.controller;

import com.qjquestion.dto.customer.CustomerDto;
import com.qjquestion.service.CustomerService;
import com.qjquestion.vo.customer.CustomerVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/customer")
@Tag(name = "会员控制器",description = "会员接口")
public class CustomerController {

    @Resource
    private CustomerService customerService;

    /**
     * 新增会员
     * @param dto 会员信息
     * @return
     */
    @Operation(summary = "新增会员",description = "新增会员")
    public CustomerVo insert(@RequestBody CustomerDto dto){
        CustomerVo customerVo = customerService.createCustomer(dto);
        return customerVo;
    }
}
